<?php

namespace App\Http\Controllers\home;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Banner;
use App\Page;
class PageController extends Controller
{
    protected $banner;

    public function __construct()
    {
        //获取banner
        $banner = Banner::where('entitle','=','page')->first();
        $this->banner  = $banner->banneritem[0];

    }
    public function index(){
        $banners=$this->banner;
        // 获取公司简介
        $com=Page::where('type',1)->first();
        // 招贤纳士
        $zxns=Page::where('type',2)->get();
        $lic=Page::where('type',3)->OrderBy('created_at','desc')->get();
        return view('home.page.index',compact('banners','com','zxns','lic'));
    }
}
